package lab02.test32;
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;
import java.util.Map;
import java.util.HashMap;
public class Test32 {
    public static void main(String[] args) {
        Map<String,String> person=new HashMap<String, String>();
        person.put("id","1");
        person.put("name","张三");
        person.put("gender","男");
        person.put("age","25");
        person.put("love","爱好Java");

        for (Map.Entry<String,String> entry:person.entrySet()){//遍历
            System.out.println(entry.getKey()+" "+entry.getValue());
            //集合中的每个元素的键与值
        }
        System.out.println("集合大小："+person.size());

        person.remove("age");

        System.out.println("age="+person.get("age"));//键对应相应位置的值
        System.out.println("集合大小："+person.size());
    }
}
